#include "map_system.h"

MapSystem::MapSystem(int global_width, int global_height, int local_width, int local_height, float grid_size)
    : global_map_(global_width, global_height, grid_size), local_map_(local_width, local_height, grid_size) 
{
    
}


void MapSystem::updateLocalMap(const std::vector<unsigned char>& map_ptr, std::vector<cv::Point3f> pts, const cv::Point3f& fuse_xyz, const cv::Point3f& fuse_rpy, int i)
{
    std::cout << "index: --------------------------- " << i+31 << std::endl;
    local_map_.update(map_ptr, pts, fuse_xyz, fuse_rpy, i);
}

void MapSystem::updateGlobalMap(const std::vector<unsigned char>& local_map)

{
    global_map_.update(local_map);
}



std::vector<unsigned char> MapSystem::getUpdatedLocalMapData()
{
    return local_map_.getUpdatedLocalMapData();
}




const std::vector<unsigned char>& MapSystem::getMapPointer() const
{
    return global_map_.getMap();
}
